home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / os2 / memsz313.zip / SOURCE.ZIP / RESTRING.H < prev    next >
Text File  |  1996-03-28  |  1KB  |  51 lines

  1. // Class RESTRING: Encapsulates the load/discard
  2. //   logic for a resource String Table entry.
  3.  
  4. #ifndef RESTRING_H
  5. #define RESTRING_H
  6.  
  7. #define INCL_BASE
  8. #include <os2.h>
  9.  
  10. class ResourceString {
  11.  
  12.    private:
  13.       HMODULE SavedModule ;
  14.       ULONG SavedId ;
  15.  
  16.       PVOID BlockPointer ;
  17.       PSZ StringPointer ;
  18.  
  19.    public:
  20.       // Constructor
  21.       ResourceString ( HMODULE Module, ULONG Id ) ;
  22.  
  23.       // Copy Constructor
  24.       ResourceString ( const ResourceString & Object ) {
  25.          SavedModule   = Object.SavedModule ;
  26.          SavedId       = Object.SavedId ;
  27.          BlockPointer  = Object.BlockPointer ;
  28.          StringPointer = Object.StringPointer ;
  29.       }
  30.  
  31.       // Typecast Operators
  32.       operator unsigned char * () {
  33.          return ( (unsigned char *) StringPointer ) ;
  34.       }
  35.  
  36.       operator char * () {
  37.          return ( (char *) StringPointer ) ;
  38.       }
  39.  
  40.       // Assignment Operator
  41.       ResourceString & operator= ( const ResourceString & Object ) {
  42.          SavedModule   = Object.SavedModule ;
  43.          SavedId       = Object.SavedId ;
  44.          BlockPointer  = Object.BlockPointer ;
  45.          StringPointer = Object.StringPointer ;
  46.          return ( *this ) ;
  47.       }
  48. } ;
  49.  
  50. #endif
  51.